from django.db import models

class NewsType(models.Model):
    tname = models.CharField(max_length=100,null=False)
    class Meta():
        db_table = 'NewsType'


class NewsInfo(models.Model):
    tid = models.ForeignKey(NewsType,on_delete=models.CASCADE)
    nTitle = models.CharField(max_length=100,null=False)
    nAuthor = models.CharField(max_length=100,null=False)
    nContent = models.CharField(max_length=100,null=False)
    nPubDateTime = models.DateField(auto_now_add=True)
    NStatus = models.BooleanField(default=False)

    class Meta():
        db_table = 'NewsInfo'


class IMG(models.Model):
    img = models.ImageField(upload_to='img')
    name = models.CharField(max_length=100)

class User(models.Model):
    username = models.CharField(max_length=40)
    password = models.CharField(max_length=40)

    class Meta():
        db_table = 'user'